<?php 
   session_start();
	if(!defined('APP'))
	{
		die('no access');
	}
	define('ROOTPATH', str_replace("modules/loader.php", '', str_replace('\\','/' ,__FILE__)));
	
	require_once(ROOTPATH.'lib/mysql.php');
	require_once(ROOTPATH.'helper/url.php');
	require_once(ROOTPATH.'modules/view.php');
	
	//tools function 
	require_once(ROOTPATH.'helper/file.php');
	
	$db = db::getInstance();
	
	$v = new view;
	$url       = $db->query("select val from options where opt='site_url'")->result_array();
	$site_path = $db->query("select val from options where opt='site_path'")->result_array();
	define('URL', $url[0]['val']);
	define('SITEPATH', $site_path[0]['val']);
